#pragma once

#include "gametemplate.h"

class CWorld;

class CScriptTemplate: public ITemplate
{
public:
	UINT characterid;
	string npc_name;
	SHORT begin_gen_time;
	SHORT repeat_gen_time;
	BYTE team;
	USHORT hp;
	USHORT att;
	USHORT def;
	string genpos;
	string goalpos;
};

class CScriptXMLParser :public CCSAXDelegator
{
public:
	bool initParsing(CWorld* world);

private:
	void parseXMLFile();
	void startElement(void *ctx, const char *name, const char **atts);
	void endElement(void *ctx, const char *name);
	void textHandler(void *ctx, const char *s, int len);

	const char *_animFile;

typedef CScriptTemplate TEMPLATE_TYPE;

private:
	string _lastelement;
	TEMPLATE_TYPE* _lastTemplate;

	CWorld* _world;
};